package br.com.site.actions;

import java.util.Map;

import org.apache.struts2.ServletActionContext;
import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.Actions;
import org.apache.struts2.convention.annotation.ParentPackage;
import org.apache.struts2.convention.annotation.Result;

import br.com.site.model.entity.Estande;
import br.com.site.util.ObjetosSuporte;

@ParentPackage( value = "fvpControle")
public class ManterQuestoesFeira extends Cadastro {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	//private static final long nivel = Long.parseLong(ServletActionContext
		//	.getServletContext().getInitParameter("mantercentronivel"));

	private Estande estande;

	private Long idEstande;

	@Actions( {

	@Action(value = "/wwwwwwwww", results = {
			@Result(location = "controle/estande.jsp", name = SUCCESS),
			@Result(type = "redirect", location = "/error", name = ERROR) }) })
	public String execute() {

		if (idEstande != null) {
			try {
				estande = Estande.find(idEstande);
			} catch (Exception e) {
				String error = "***loadEstande!loadEstande*** <br>"
						+ e.toString();
				getSessao().put("myerror", error);
				return ERROR;
			}
		}
		return SUCCESS;
	}

	// addActionError("Acesso Negado!");
	// return BLOQUEAR;

	public Estande getEstande() {
		return estande;
	}

	public void setEstande(Estande estande) {
		this.estande = estande;
	}

	public Long getIdEstande() {
		return idEstande;
	}

	public void setIdEstande(Long idEstande) {
		this.idEstande = idEstande;
	}

}
